package com.retail.shopping.server.mapper;

import java.util.List;
import com.retail.shopping.common.domain.ShoppingCart;
import com.retail.shopping.common.domain.request.CartInsertRequest;
import org.apache.ibatis.annotations.Param;

/**
 * 购物车主Mapper接口
 * 
 * @author retail
 * @date 2024-02-27
 */
public interface ShoppingCartMapper 
{
    /**
     * 查询购物车主
     * 
     * @param cartId 购物车主主键
     * @return 购物车主
     */
    public ShoppingCart selectShoppingCartByCartId(Long cartId);

    /**
     * 查询购物车主列表
     * 
     * @param shoppingCart 购物车主
     * @return 购物车主集合
     */
    public List<ShoppingCart> selectShoppingCartList(ShoppingCart shoppingCart);

    /**
     * 新增购物车主
     * 
     * @param shoppingCart 购物车主
     * @return 结果
     */
    public int insertShoppingCart(ShoppingCart shoppingCart);

    /**
     * 修改购物车主
     * 
     * @param shoppingCart 购物车主
     * @return 结果
     */
    public int updateShoppingCart(ShoppingCart shoppingCart);

    /**
     * 删除购物车主
     * 
     * @param cartId 购物车主主键
     * @return 结果
     */
    public int deleteShoppingCartByCartId(Long cartId);

    /**
     * 批量删除购物车主
     * 
     * @param cartIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteShoppingCartByCartIds(Long[] cartIds);


    ShoppingCart selectShoppingFindByUserId(Integer userId);

    int shoppingCartAdd(CartInsertRequest userId);

    List<ShoppingCart> selectShopCartFindByUserId(@Param("userIds") List<Integer> userIds);
}
